<?php
/**
 * Dependency custom exporter
 *
 * PHP version 5
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id:$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
require_once 'W/Dependency/Exporter/File/Abstract.php';
/**
 * Dependency custom exporter
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
class W_Dependency_Exporter_Custom extends W_Dependency_Exporter_File_Abstract
{
    private $format;
    public function configure($options=null)
    {
        parent::configure($options);
        if (true === isset($options['output'])) {
            $options['extension'] = substr($options['output'],strrpos($options['output'],'.')+1);
        }
        if (false === isset($options['extension'])) {
            throw new RuntimeException("No extension provided");
        }
        $this->format = $options['extension'];
        if (false === isset($options['template'])) {
            throw new RuntimeException("No template provided");
        }
    }
    public function getFormat()
    {
        return $this->format;
    }
}